package com.cherrypt.api.core.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cherrypt.api.model.dataobject.Post;


/**
 * @author intent
 * @date 2019/8/2 15:54
 * @about <link href='http://zzyitj.xyz/'/>
 */
public interface PostService extends IService<Post> {
    IPage<Post> getPostPage(int pageIndex, int pageSize, boolean wait);

    IPage<Post> getPostPageOrderByTitle(int pageIndex, int pageSize, boolean desc, boolean wait);

    IPage<Post> getPostPageOrderByCreated(int pageIndex, int pageSize, boolean desc, boolean wait);

    IPage<Post> getPostPageOrderByUid(int pageIndex, int pageSize, boolean desc, boolean wait);

    IPage<Post> getPostPageOrderBySize(int pageIndex, int pageSize, boolean desc, boolean wait);

    IPage<Post> getPostPageByCategoryName(int pageIndex, int pageSize, String categoryName, boolean wait);

    IPage<Post> getPostPageByCategoryNameOrderByCreated(int pageIndex, int pageSize, String categoryName, boolean desc, boolean wait);

    IPage<Post> getPostPageByCategoryNameOrderByUid(int pageIndex, int pageSize, String categoryName, boolean desc, boolean wait);

    IPage<Post> getPostPageByCategoryNameOrderByTitle(int pageIndex, int pageSize, String categoryName, boolean desc, boolean wait);

    IPage<Post> getPostPageByCategoryNameOrderBySize(int pageIndex, int pageSize, String categoryName, boolean desc, boolean wait);

    int getCount(boolean wait);

    int getCountByCategoryName(String categoryName, boolean wait);

    int getCountByUid(int uid);

    Post getModifyAndWait(int pid);

    boolean updateWait(int pid, boolean wait);

    boolean updateEnable(int pid, boolean enable);
}
